<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义JS框架</title>
    <script src="js/daofree.js"></script>
</head>
<body>
        <div id="div1">div1....</div>
        <div id="div2">div2....</div>


<script>
    //1. 根据id获取元素对象
    // let div1 = document.getElementById("div1");
    // let div2 = document.getElementById("div2");

    // let div1 = get("div1");
    // let div2 = get("div2");

    var div1 = $("div1");
    var div2 = $("div2");
    //2.获取标签体内容
    alert(div1.innerHTML);
    alert(div2.innerHTML);

    //document.getElementById 长记，麻烦
    // 封装方法，根据id获取元素对象,简化书写
    // function get(id) {
    //     let obj = document.getElementById(id);
    //     return obj;
    // }


</script>
</body>
</html>